﻿using System;
using System.IO;

namespace Tzx.Tools.Payroll2Images.Exe.Api
{
    /// <summary>
    /// API调用各状态(注意因为要json序列化,所以要有默认公开构造函数)
    /// </summary>
    public class ApiStatus
    {
        /// <summary>
        /// 文件短名,用来获取消息接收人
        /// </summary>
        public string file_short_name { get; set; } //private set

        /// <summary>
        /// 文件路径全名
        /// </summary>
        public string file_full_path_name
        {
            get { return _file_full_path_name; }
            set
            {
                //全名
                _file_full_path_name = string.Format("{0}", value);

                //短名
                if (string.IsNullOrEmpty(file_short_name))
                {
                    this.file_short_name = Path.GetFileName(file_full_path_name);
                }
            }
        }
        private string _file_full_path_name = null;

        #region 钉钉(会话,文件,用户)

        /// <summary>
        /// 上传文件到钉钉成功后返回的文件id
        /// </summary>
        public string media_id { get; set; }

        /// <summary>
        /// 消息任务id,提交后获得task_id,然后再用这个task_id去做下一步操作(各状态和撤回)
        /// </summary>
        public string task_id { get; set; }

        /// <summary>
        /// 接收人钉钉userid
        /// </summary>
        public string user_idss { get; set; }

        #endregion

        #region 钉钉api调用状态

        /// <summary>
        /// S1.是否已提交发送
        /// </summary>
        public YesOrNo status_submit_send { get; set; }

        /// <summary>
        /// S2.是否发送进度已完成
        /// </summary>
        public YesOrNo status_progress { get; set; }

        /// <summary>
        /// S3.是否结果已读
        /// </summary>
        public YesOrNo status_result_read { get; set; }

        /// <summary>
        /// S4.是否已撤回
        /// </summary>
        public YesOrNo status_recall { get; set; }

        #endregion

        /// <summary>
        /// 备注消息
        /// </summary>
        public string remark_text { get; set; }

        /// <summary>
        /// ListViewItem是否已勾选
        /// </summary>
        public bool is_checked { get; set; }
    }
}
